package com.heima.utils.common.thread;

import com.heima.model.admin.pojos.AdUser;



/**
 * WmThread工具类
 */
public class AdThreadLocalUtil {

    private final static ThreadLocal<AdUser> ADMIN_THREAD_LOCAL = new ThreadLocal<AdUser>();


    //存入线程
    public static void setUser(AdUser adUser) {
        ADMIN_THREAD_LOCAL.set(adUser);
    }


    //从线程中获取
    public static AdUser getUser() {
        return ADMIN_THREAD_LOCAL.get();
    }

    //清理线程
    public static void removeUser() {
        ADMIN_THREAD_LOCAL.remove();
    }
}
